/**
 * EmployeeRoutingModule模块类
 * 用于配置员工模块的路由
 */
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';

//引入员工列表组件和员工添加组件
import {EmployeeListComponent} from './employee-list/employee-list.component';
import {EmployeeAddComponent} from './employee-add/employee-add.component';

//定义模块路由
const routes: Routes = [
  {path: '', component: EmployeeListComponent}, //默认路由，指向员工列表组件
  {path: 'add', component: EmployeeAddComponent}, //路径为/add时，指向员工添加组件
];

/**
 * Angular模块装饰器
 */
@NgModule({
  imports: [RouterModule.forChild(routes)], //将定义的路由导入RouterModule
  exports: [RouterModule] //导出RouterModule供其他模块使用
})
export class EmployeeRoutingModule {
}
